using System.Diagnostics.SymbolStore;
using System.Runtime.InteropServices;

namespace System.Reflection.Emit
{
	public class EmitHelper
	{
		private readonly ILGenerator _ilGenerator;

		public EmitHelper @add
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Add);
				return this;
			}
		}

		public EmitHelper add_ovf
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Add_Ovf);
				return this;
			}
		}

		public EmitHelper add_ovf_un
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Add_Ovf_Un);
				return this;
			}
		}

		public EmitHelper and
		{
			get
			{
				_ilGenerator.Emit(OpCodes.And);
				return this;
			}
		}

		public EmitHelper arglist
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Arglist);
				return this;
			}
		}

		public EmitHelper @break
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Break);
				return this;
			}
		}

		public EmitHelper ceq
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ceq);
				return this;
			}
		}

		public EmitHelper cgt
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Cgt);
				return this;
			}
		}

		public EmitHelper cgt_un
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Cgt_Un);
				return this;
			}
		}

		public EmitHelper ckfinite
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ckfinite);
				return this;
			}
		}

		public EmitHelper clt
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Clt);
				return this;
			}
		}

		public EmitHelper clt_un
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Clt_Un);
				return this;
			}
		}

		public EmitHelper conv_i
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_I);
				return this;
			}
		}

		public EmitHelper conv_i1
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_I1);
				return this;
			}
		}

		public EmitHelper conv_i2
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_I2);
				return this;
			}
		}

		public EmitHelper conv_i4
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_I4);
				return this;
			}
		}

		public EmitHelper conv_i8
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_I8);
				return this;
			}
		}

		public EmitHelper conv_ovf_i
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_Ovf_I);
				return this;
			}
		}

		public EmitHelper conv_ovf_i_un
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_Ovf_I_Un);
				return this;
			}
		}

		public EmitHelper conv_ovf_i1
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_Ovf_I1);
				return this;
			}
		}

		public EmitHelper conv_ovf_i1_un
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_Ovf_I1_Un);
				return this;
			}
		}

		public EmitHelper conv_ovf_i2
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_Ovf_I2);
				return this;
			}
		}

		public EmitHelper conv_ovf_i2_un
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_Ovf_I2_Un);
				return this;
			}
		}

		public EmitHelper conv_ovf_i4
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_Ovf_I2_Un);
				return this;
			}
		}

		public EmitHelper conv_ovf_i4_un
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_Ovf_I4_Un);
				return this;
			}
		}

		public EmitHelper conv_ovf_i8
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_Ovf_I8);
				return this;
			}
		}

		public EmitHelper conv_ovf_i8_un
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_Ovf_I8_Un);
				return this;
			}
		}

		public EmitHelper conv_ovf_u
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_Ovf_U);
				return this;
			}
		}

		public EmitHelper conv_ovf_u_un
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_Ovf_U_Un);
				return this;
			}
		}

		public EmitHelper conv_ovf_u1
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_Ovf_U1);
				return this;
			}
		}

		public EmitHelper conv_ovf_u1_un
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_Ovf_U1_Un);
				return this;
			}
		}

		public EmitHelper conv_ovf_u2
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_Ovf_U2);
				return this;
			}
		}

		public EmitHelper conv_ovf_u2_un
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_Ovf_U2_Un);
				return this;
			}
		}

		public EmitHelper conv_ovf_u4
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_Ovf_U4);
				return this;
			}
		}

		public EmitHelper conv_ovf_u4_un
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_Ovf_U4_Un);
				return this;
			}
		}

		public EmitHelper conv_ovf_u8
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_Ovf_U8);
				return this;
			}
		}

		public EmitHelper conv_ovf_u8_un
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_Ovf_U8_Un);
				return this;
			}
		}

		public EmitHelper conv_r_un
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_R_Un);
				return this;
			}
		}

		public EmitHelper conv_r4
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_R4);
				return this;
			}
		}

		public EmitHelper conv_r8
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_R8);
				return this;
			}
		}

		public EmitHelper conv_u
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_U);
				return this;
			}
		}

		public EmitHelper conv_u1
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_U1);
				return this;
			}
		}

		public EmitHelper conv_u2
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_U2);
				return this;
			}
		}

		public EmitHelper conv_u4
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_U4);
				return this;
			}
		}

		public EmitHelper conv_u8
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Conv_U8);
				return this;
			}
		}

		public EmitHelper cpblk
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Cpblk);
				return this;
			}
		}

		public EmitHelper div
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Div);
				return this;
			}
		}

		public EmitHelper div_un
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Div_Un);
				return this;
			}
		}

		public EmitHelper dup
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Dup);
				return this;
			}
		}

		public EmitHelper endfilter
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Endfilter);
				return this;
			}
		}

		public EmitHelper endfinally
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Endfinally);
				return this;
			}
		}

		public ILGenerator ILGenerator
		{
			get
			{
				return _ilGenerator;
			}
		}

		public EmitHelper initblk
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Initblk);
				return this;
			}
		}

		public EmitHelper ldarg_0
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldarg_0);
				return this;
			}
		}

		public EmitHelper ldarg_1
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldarg_1);
				return this;
			}
		}

		public EmitHelper ldarg_2
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldarg_2);
				return this;
			}
		}

		public EmitHelper ldarg_3
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldarg_3);
				return this;
			}
		}

		public EmitHelper ldc_i4_0
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldc_I4_0);
				return this;
			}
		}

		public EmitHelper ldc_i4_1
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldc_I4_1);
				return this;
			}
		}

		public EmitHelper ldc_i4_2
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldc_I4_2);
				return this;
			}
		}

		public EmitHelper ldc_i4_3
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldc_I4_3);
				return this;
			}
		}

		public EmitHelper ldc_i4_4
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldc_I4_4);
				return this;
			}
		}

		public EmitHelper ldc_i4_5
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldc_I4_5);
				return this;
			}
		}

		public EmitHelper ldc_i4_6
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldc_I4_6);
				return this;
			}
		}

		public EmitHelper ldc_i4_7
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldc_I4_7);
				return this;
			}
		}

		public EmitHelper ldc_i4_8
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldc_I4_8);
				return this;
			}
		}

		public EmitHelper ldc_i4_m1
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldc_I4_M1);
				return this;
			}
		}

		public EmitHelper ldelem_i
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldelem_I);
				return this;
			}
		}

		public EmitHelper ldelem_i1
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldelem_I1);
				return this;
			}
		}

		public EmitHelper ldelem_i2
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldelem_I2);
				return this;
			}
		}

		public EmitHelper ldelem_i4
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldelem_I4);
				return this;
			}
		}

		public EmitHelper ldelem_i8
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldelem_I8);
				return this;
			}
		}

		public EmitHelper ldelem_r4
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldelem_R4);
				return this;
			}
		}

		public EmitHelper ldelem_r8
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldelem_R8);
				return this;
			}
		}

		public EmitHelper ldelem_ref
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldelem_Ref);
				return this;
			}
		}

		public EmitHelper ldelem_u1
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldelem_U1);
				return this;
			}
		}

		public EmitHelper ldelem_u2
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldelem_U2);
				return this;
			}
		}

		public EmitHelper ldelem_u4
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldelem_U4);
				return this;
			}
		}

		public EmitHelper ldind_i
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldind_I);
				return this;
			}
		}

		public EmitHelper ldind_i1
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldind_I1);
				return this;
			}
		}

		public EmitHelper ldind_i2
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldind_I2);
				return this;
			}
		}

		public EmitHelper ldind_i4
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldind_I4);
				return this;
			}
		}

		public EmitHelper ldind_i8
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldind_I8);
				return this;
			}
		}

		public EmitHelper ldind_r4
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldind_R4);
				return this;
			}
		}

		public EmitHelper ldind_r8
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldind_R8);
				return this;
			}
		}

		public EmitHelper ldind_ref
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldind_Ref);
				return this;
			}
		}

		public EmitHelper ldind_u1
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldind_U1);
				return this;
			}
		}

		public EmitHelper ldind_u2
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldind_U2);
				return this;
			}
		}

		public EmitHelper ldind_u4
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldind_U4);
				return this;
			}
		}

		public EmitHelper ldlen
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldlen);
				return this;
			}
		}

		public EmitHelper ldloc_0
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldloc_0);
				return this;
			}
		}

		public EmitHelper ldloc_1
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldloc_1);
				return this;
			}
		}

		public EmitHelper ldloc_2
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldloc_2);
				return this;
			}
		}

		public EmitHelper ldloc_3
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldloc_3);
				return this;
			}
		}

		public EmitHelper ldnull
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Ldnull);
				return this;
			}
		}

		public EmitHelper localloc
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Localloc);
				return this;
			}
		}

		public EmitHelper mul
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Mul);
				return this;
			}
		}

		public EmitHelper mul_ovf
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Mul_Ovf);
				return this;
			}
		}

		public EmitHelper mul_ovf_un
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Mul_Ovf_Un);
				return this;
			}
		}

		public EmitHelper neg
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Neg);
				return this;
			}
		}

		public EmitHelper nop
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Nop);
				return this;
			}
		}

		public EmitHelper not
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Not);
				return this;
			}
		}

		public EmitHelper or
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Or);
				return this;
			}
		}

		public EmitHelper pop
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Pop);
				return this;
			}
		}

		public EmitHelper @readonly
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Readonly);
				return this;
			}
		}

		public EmitHelper refanytype
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Refanytype);
				return this;
			}
		}

		public EmitHelper rem
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Rem);
				return this;
			}
		}

		public EmitHelper rem_un
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Rem_Un);
				return this;
			}
		}

		public EmitHelper rethrow
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Rethrow);
				return this;
			}
		}

		public EmitHelper shl
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Shl);
				return this;
			}
		}

		public EmitHelper shr
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Shr);
				return this;
			}
		}

		public EmitHelper shr_un
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Shr_Un);
				return this;
			}
		}

		public EmitHelper stelem_i
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Stelem_I);
				return this;
			}
		}

		public EmitHelper stelem_i1
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Stelem_I1);
				return this;
			}
		}

		public EmitHelper stelem_i2
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Stelem_I2);
				return this;
			}
		}

		public EmitHelper stelem_i4
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Stelem_I4);
				return this;
			}
		}

		public EmitHelper stelem_i8
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Stelem_I8);
				return this;
			}
		}

		public EmitHelper stelem_r4
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Stelem_R4);
				return this;
			}
		}

		public EmitHelper stelem_r8
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Stelem_R8);
				return this;
			}
		}

		public EmitHelper stelem_ref
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Stelem_Ref);
				return this;
			}
		}

		public EmitHelper stind_i
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Stind_I);
				return this;
			}
		}

		public EmitHelper stind_i1
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Stind_I1);
				return this;
			}
		}

		public EmitHelper stind_i2
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Stind_I2);
				return this;
			}
		}

		public EmitHelper stind_i4
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Stind_I4);
				return this;
			}
		}

		public EmitHelper stind_i8
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Stind_I8);
				return this;
			}
		}

		public EmitHelper stind_r4
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Stind_R4);
				return this;
			}
		}

		public EmitHelper stind_r8
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Stind_R8);
				return this;
			}
		}

		public EmitHelper stind_ref
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Stind_Ref);
				return this;
			}
		}

		public EmitHelper stloc_0
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Stloc_0);
				return this;
			}
		}

		public EmitHelper stloc_1
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Stloc_1);
				return this;
			}
		}

		public EmitHelper stloc_2
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Stloc_2);
				return this;
			}
		}

		public EmitHelper stloc_3
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Stloc_3);
				return this;
			}
		}

		public EmitHelper sub
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Sub);
				return this;
			}
		}

		public EmitHelper sub_ovf
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Sub_Ovf);
				return this;
			}
		}

		public EmitHelper sub_ovf_un
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Sub_Ovf_Un);
				return this;
			}
		}

		public EmitHelper tailcall
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Tailcall);
				return this;
			}
		}

		public EmitHelper @throw
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Throw);
				return this;
			}
		}

		public EmitHelper @volatile
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Volatile);
				return this;
			}
		}

		public EmitHelper xor
		{
			get
			{
				_ilGenerator.Emit(OpCodes.Xor);
				return this;
			}
		}

		public EmitHelper(ILGenerator ilGenerator)
		{
			Guard.ArgumentNotNull(ilGenerator, "ilGenerator");
			_ilGenerator = ilGenerator;
		}

		public void AddMaxStackSize(int size)
		{
			FieldInfo field = _ilGenerator.GetType().GetField("m_maxStackSize", BindingFlags.Instance | BindingFlags.NonPublic);
			if (field != null)
			{
				size += (int)field.GetValue(_ilGenerator);
				field.SetValue(_ilGenerator, size);
			}
		}

		public EmitHelper BeginCatchBlock(Type exceptionType)
		{
			_ilGenerator.BeginCatchBlock(exceptionType);
			return this;
		}

		public EmitHelper BeginExceptFilterBlock()
		{
			_ilGenerator.BeginExceptFilterBlock();
			return this;
		}

		public Label BeginExceptionBlock()
		{
			return _ilGenerator.BeginExceptionBlock();
		}

		public EmitHelper BeginFaultBlock()
		{
			_ilGenerator.BeginFaultBlock();
			return this;
		}

		public EmitHelper BeginFinallyBlock()
		{
			_ilGenerator.BeginFinallyBlock();
			return this;
		}

		public EmitHelper BeginScope()
		{
			_ilGenerator.BeginScope();
			return this;
		}

		public EmitHelper beq(Label label)
		{
			_ilGenerator.Emit(OpCodes.Beq, label);
			return this;
		}

		public EmitHelper beq_s(Label label)
		{
			_ilGenerator.Emit(OpCodes.Beq_S, label);
			return this;
		}

		public EmitHelper bge(Label label)
		{
			_ilGenerator.Emit(OpCodes.Bge, label);
			return this;
		}

		public EmitHelper bge_s(Label label)
		{
			_ilGenerator.Emit(OpCodes.Bge_S, label);
			return this;
		}

		public EmitHelper bge_un(Label label)
		{
			_ilGenerator.Emit(OpCodes.Bge_Un, label);
			return this;
		}

		public EmitHelper bge_un_s(Label label)
		{
			_ilGenerator.Emit(OpCodes.Bge_Un_S, label);
			return this;
		}

		public EmitHelper bgt(Label label)
		{
			_ilGenerator.Emit(OpCodes.Bgt, label);
			return this;
		}

		public EmitHelper bgt_s(Label label)
		{
			_ilGenerator.Emit(OpCodes.Bgt_S, label);
			return this;
		}

		public EmitHelper bgt_un(Label label)
		{
			_ilGenerator.Emit(OpCodes.Bgt_Un, label);
			return this;
		}

		public EmitHelper bgt_un_s(Label label)
		{
			_ilGenerator.Emit(OpCodes.Bgt_Un_S, label);
			return this;
		}

		public EmitHelper ble(Label label)
		{
			_ilGenerator.Emit(OpCodes.Ble, label);
			return this;
		}

		public EmitHelper ble_s(Label label)
		{
			_ilGenerator.Emit(OpCodes.Ble_S, label);
			return this;
		}

		public EmitHelper ble_un(Label label)
		{
			_ilGenerator.Emit(OpCodes.Ble_Un, label);
			return this;
		}

		public EmitHelper ble_un_s(Label label)
		{
			_ilGenerator.Emit(OpCodes.Ble_Un_S, label);
			return this;
		}

		public EmitHelper blt(Label label)
		{
			_ilGenerator.Emit(OpCodes.Blt, label);
			return this;
		}

		public EmitHelper blt_s(Label label)
		{
			_ilGenerator.Emit(OpCodes.Blt_S, label);
			return this;
		}

		public EmitHelper blt_un(Label label)
		{
			_ilGenerator.Emit(OpCodes.Blt_Un, label);
			return this;
		}

		public EmitHelper blt_un_s(Label label)
		{
			_ilGenerator.Emit(OpCodes.Blt_Un_S, label);
			return this;
		}

		public EmitHelper bne_un(Label label)
		{
			_ilGenerator.Emit(OpCodes.Bne_Un, label);
			return this;
		}

		public EmitHelper bne_un_s(Label label)
		{
			_ilGenerator.Emit(OpCodes.Bne_Un_S, label);
			return this;
		}

		public EmitHelper box(Type type)
		{
			_ilGenerator.Emit(OpCodes.Box, type);
			return this;
		}

		public EmitHelper boxIfValueType(Type type)
		{
			if (type == null)
			{
				throw new ArgumentNullException("type");
			}
			return (type.IsValueType ? box(type) : this);
		}

		public EmitHelper br(Label label)
		{
			_ilGenerator.Emit(OpCodes.Br, label);
			return this;
		}

		public EmitHelper br_s(Label label)
		{
			_ilGenerator.Emit(OpCodes.Br_S, label);
			return this;
		}

		public EmitHelper brfalse(Label label)
		{
			_ilGenerator.Emit(OpCodes.Brfalse, label);
			return this;
		}

		public EmitHelper brfalse_s(Label label)
		{
			_ilGenerator.Emit(OpCodes.Brfalse_S, label);
			return this;
		}

		public EmitHelper brtrue(Label label)
		{
			_ilGenerator.Emit(OpCodes.Brtrue, label);
			return this;
		}

		public EmitHelper brtrue_s(Label label)
		{
			_ilGenerator.Emit(OpCodes.Brtrue_S, label);
			return this;
		}

		public EmitHelper call(bool isStatic, MethodInfo methodInfo)
		{
			_ilGenerator.Emit((isStatic ? OpCodes.Call : OpCodes.Callvirt), methodInfo);
			return this;
		}

		public EmitHelper call(MethodInfo methodInfo)
		{
			_ilGenerator.Emit(OpCodes.Call, methodInfo);
			return this;
		}

		public EmitHelper call(ConstructorInfo constructorInfo)
		{
			_ilGenerator.Emit(OpCodes.Call, constructorInfo);
			return this;
		}

		public EmitHelper call(MethodInfo methodInfo, Type[] optionalParameterTypes)
		{
			_ilGenerator.EmitCall(OpCodes.Call, methodInfo, optionalParameterTypes);
			return this;
		}

		public EmitHelper call(Type type, string methodName, params Type[] optionalParameterTypes)
		{
			if (type == null)
			{
				throw new ArgumentNullException("type");
			}
			MethodInfo method = type.GetMethod(methodName, optionalParameterTypes);
			if (method == null)
			{
				throw CreateNoSuchMethodException(type, methodName);
			}
			return call(method);
		}

		public EmitHelper call(Type type, string methodName, BindingFlags bindingFlags, params Type[] optionalParameterTypes)
		{
			if (type == null)
			{
				throw new ArgumentNullException("type");
			}
			MethodInfo method = type.GetMethod(methodName, bindingFlags, null, optionalParameterTypes, null);
			if (method == null)
			{
				throw CreateNoSuchMethodException(type, methodName);
			}
			return call(method);
		}

		public EmitHelper calli(CallingConvention unmanagedCallConv, Type returnType, Type[] parameterTypes)
		{
			_ilGenerator.EmitCalli(OpCodes.Calli, unmanagedCallConv, returnType, parameterTypes);
			return this;
		}

		public EmitHelper calli(CallingConventions callingConvention, Type returnType, Type[] parameterTypes, Type[] optionalParameterTypes)
		{
			_ilGenerator.EmitCalli(OpCodes.Calli, callingConvention, returnType, parameterTypes, optionalParameterTypes);
			return this;
		}

		public EmitHelper callvirt(MethodInfo methodInfo)
		{
			_ilGenerator.Emit(OpCodes.Callvirt, methodInfo);
			return this;
		}

		public EmitHelper callvirt(MethodInfo methodInfo, Type[] optionalParameterTypes)
		{
			_ilGenerator.EmitCall(OpCodes.Callvirt, methodInfo, optionalParameterTypes);
			return this;
		}

		public EmitHelper callvirt(Type type, string methodName, params Type[] optionalParameterTypes)
		{
			if (type == null)
			{
				throw new ArgumentNullException("type");
			}
			MethodInfo method = type.GetMethod(methodName, optionalParameterTypes);
			if (method == null)
			{
				throw CreateNoSuchMethodException(type, methodName);
			}
			return callvirt(method);
		}

		public EmitHelper callvirt(Type type, string methodName, BindingFlags bindingFlags, params Type[] optionalParameterTypes)
		{
			MethodInfo methodInfo = (optionalParameterTypes == null ? type.GetMethod(methodName, bindingFlags) : type.GetMethod(methodName, bindingFlags, null, optionalParameterTypes, null));
			if (methodInfo == null)
			{
				throw CreateNoSuchMethodException(type, methodName);
			}
			return callvirt(methodInfo, null);
		}

		public EmitHelper callvirt(Type type, string methodName, BindingFlags bindingFlags)
		{
			return callvirt(type, methodName, bindingFlags, null);
		}

		public EmitHelper castclass(Type type)
		{
			_ilGenerator.Emit(OpCodes.Castclass, type);
			return this;
		}

		public EmitHelper CastFromObject(Type type)
		{
			EmitHelper emitHelper;
			Guard.ArgumentNotNull(type, "type");
			if (type == typeof(object))
			{
				emitHelper = this;
			}
			else
			{
				emitHelper = (type.IsValueType ? unbox_any(type) : castclass(type));
			}
			return emitHelper;
		}

		public EmitHelper castType(Type type)
		{
			if (type == null)
			{
				throw new ArgumentNullException("type");
			}
			return (type.IsValueType ? unbox_any(type) : castclass(type));
		}

		public EmitHelper constrained(Type type)
		{
			_ilGenerator.Emit(OpCodes.Constrained, type);
			return this;
		}

		public EmitHelper conv(Type type)
		{
			if (type == null)
			{
				throw new ArgumentNullException("type");
			}
			switch (Type.GetTypeCode(type))
			{
				case TypeCode.Boolean:
				case TypeCode.SByte:
				{
					conv_i1.end();
					break;
				}
				case TypeCode.Char:
				case TypeCode.UInt16:
				{
					conv_u2.end();
					break;
				}
				case TypeCode.Byte:
				{
					conv_u1.end();
					break;
				}
				case TypeCode.Int16:
				{
					conv_i2.end();
					break;
				}
				case TypeCode.Int32:
				{
					conv_i4.end();
					break;
				}
				case TypeCode.UInt32:
				{
					conv_u4.end();
					break;
				}
				case TypeCode.Int64:
				{
					conv_i8.end();
					break;
				}
				case TypeCode.UInt64:
				{
					conv_u8.end();
					break;
				}
				case TypeCode.Single:
				{
					conv_r4.end();
					break;
				}
				case TypeCode.Double:
				{
					conv_r8.end();
					break;
				}
				default:
				{
					if ((!type.IsGenericType ? false : type.GetGenericTypeDefinition() == typeof(Nullable<>)))
					{
						ConstructorInfo constructor = type.GetConstructor(type.GetGenericArguments());
						if (constructor != null)
						{
							newobj(constructor);
							break;
						}
					}
					throw CreateNotExpectedTypeException(type);
				}
			}
			return this;
		}

		public EmitHelper cpobj(Type type)
		{
			_ilGenerator.Emit(OpCodes.Cpobj, type);
			return this;
		}

		private static Exception CreateNoSuchMethodException(Type type, string methodName)
		{
			Exception invalidOperationException = new InvalidOperationException(string.Format("Method {1} cannot be found in type {0}", type.FullName, methodName));
			return invalidOperationException;
		}

		private static Exception CreateNotExpectedTypeException(Type type)
		{
			return new ArgumentException(string.Format("Type {0} is not expected in this context", type.FullName));
		}

		public LocalBuilder DeclareLocal(Type localType)
		{
			return _ilGenerator.DeclareLocal(localType);
		}

		public LocalBuilder DeclareLocal(Type localType, bool pinned)
		{
			return _ilGenerator.DeclareLocal(localType, pinned);
		}

		public Label DefineLabel()
		{
			return _ilGenerator.DefineLabel();
		}

		public void end()
		{
		}

		public EmitHelper EndExceptionBlock()
		{
			_ilGenerator.EndExceptionBlock();
			return this;
		}

		public EmitHelper EndScope()
		{
			_ilGenerator.EndScope();
			return this;
		}

		public EmitHelper Init(LocalBuilder localBuilder)
		{
			Guard.ArgumentNotNull(localBuilder, "localBuilder");
			Type localType = localBuilder.LocalType;
			if (localType.IsEnum)
			{
				localType = Enum.GetUnderlyingType(localType);
			}
			return (!localType.IsValueType || localType.IsPrimitive ? LoadInitValue(localType).stloc(localBuilder) : ldloca(localBuilder).initobj(localType));
		}

		public EmitHelper initobj(Type type)
		{
			_ilGenerator.Emit(OpCodes.Initobj, type);
			return this;
		}

		public EmitHelper isinst(Type type)
		{
			_ilGenerator.Emit(OpCodes.Isinst, type);
			return this;
		}

		public EmitHelper jmp(MethodInfo methodInfo)
		{
			_ilGenerator.Emit(OpCodes.Jmp, methodInfo);
			return this;
		}

		public EmitHelper ldarg(short index)
		{
			_ilGenerator.Emit(OpCodes.Ldarg, index);
			return this;
		}

		public EmitHelper ldarg(int index)
		{
			switch (index)
			{
				case 0:
				{
					ldarg_0.end();
					break;
				}
				case 1:
				{
					ldarg_1.end();
					break;
				}
				case 2:
				{
					ldarg_2.end();
					break;
				}
				case 3:
				{
					ldarg_3.end();
					break;
				}
				default:
				{
					if (index > 255)
					{
						if (index > 32767)
						{
							throw new ArgumentOutOfRangeException("index");
						}
						ldarg((short)index);
					}
					else
					{
						ldarg_s((byte)index);
					}
					break;
				}
			}
			return this;
		}

		public EmitHelper ldarg_s(byte index)
		{
			_ilGenerator.Emit(OpCodes.Ldarg_S, index);
			return this;
		}

		public EmitHelper ldarga(short index)
		{
			_ilGenerator.Emit(OpCodes.Ldarga, index);
			return this;
		}

		public EmitHelper ldarga(int index)
		{
			if (index > 255)
			{
				if (index > 32767)
				{
					throw new ArgumentOutOfRangeException("index");
				}
				ldarga((short)index);
			}
			else
			{
				ldarga_s((byte)index);
			}
			return this;
		}

		public EmitHelper ldarga_s(byte index)
		{
			_ilGenerator.Emit(OpCodes.Ldarga_S, index);
			return this;
		}

		public EmitHelper ldc_bool(bool b)
		{
			_ilGenerator.Emit((b ? OpCodes.Ldc_I4_1 : OpCodes.Ldc_I4_0));
			return this;
		}

		public EmitHelper ldc_i4(int num)
		{
			_ilGenerator.Emit(OpCodes.Ldc_I4, num);
			return this;
		}

		public EmitHelper ldc_i4_(int num)
		{
			switch (num)
			{
				case -1:
				{
					ldc_i4_m1.end();
					break;
				}
				case 0:
				{
					ldc_i4_0.end();
					break;
				}
				case 1:
				{
					ldc_i4_1.end();
					break;
				}
				case 2:
				{
					ldc_i4_2.end();
					break;
				}
				case 3:
				{
					ldc_i4_3.end();
					break;
				}
				case 4:
				{
					ldc_i4_4.end();
					break;
				}
				case 5:
				{
					ldc_i4_5.end();
					break;
				}
				case 6:
				{
					ldc_i4_6.end();
					break;
				}
				case 7:
				{
					ldc_i4_7.end();
					break;
				}
				case 8:
				{
					ldc_i4_8.end();
					break;
				}
				default:
				{
					if ((num < -128 ? true : num > 127))
					{
						ldc_i4(num);
					}
					else
					{
						ldc_i4_s((sbyte)num);
					}
					break;
				}
			}
			return this;
		}

		public EmitHelper ldc_i4_s(sbyte num)
		{
			_ilGenerator.Emit(OpCodes.Ldc_I4_S, num);
			return this;
		}

		public EmitHelper ldc_i8(long num)
		{
			_ilGenerator.Emit(OpCodes.Ldc_I8, num);
			return this;
		}

		public EmitHelper ldc_r4(float num)
		{
			_ilGenerator.Emit(OpCodes.Ldc_R4, num);
			return this;
		}

		public EmitHelper ldc_r8(double num)
		{
			_ilGenerator.Emit(OpCodes.Ldc_R8, num);
			return this;
		}

		public EmitHelper ldelem(Type type)
		{
			_ilGenerator.Emit(OpCodes.Ldelem, type);
			return this;
		}

		public EmitHelper ldelema(Type type)
		{
			_ilGenerator.Emit(OpCodes.Ldelema, type);
			return this;
		}

		public EmitHelper ldfld(bool isStatic, FieldInfo fieldInfo)
		{
			_ilGenerator.Emit((isStatic ? OpCodes.Ldsfld : OpCodes.Ldfld), fieldInfo);
			return this;
		}

		public EmitHelper ldfld(FieldInfo fieldInfo)
		{
			_ilGenerator.Emit(OpCodes.Ldfld, fieldInfo);
			return this;
		}

		public EmitHelper ldflda(FieldInfo fieldInfo)
		{
			_ilGenerator.Emit(OpCodes.Ldflda, fieldInfo);
			return this;
		}

		public EmitHelper ldftn(MethodInfo methodInfo)
		{
			_ilGenerator.Emit(OpCodes.Ldftn, methodInfo);
			return this;
		}

		public EmitHelper ldind(Type type)
		{
			if (type == null)
			{
				throw new ArgumentNullException("type");
			}
			switch (Type.GetTypeCode(type))
			{
				case TypeCode.Boolean:
				case TypeCode.SByte:
				case TypeCode.Byte:
				{
					ldind_i1.end();
					break;
				}
				case TypeCode.Char:
				case TypeCode.Int16:
				case TypeCode.UInt16:
				{
					ldind_i2.end();
					break;
				}
				case TypeCode.Int32:
				case TypeCode.UInt32:
				{
					ldind_i4.end();
					break;
				}
				case TypeCode.Int64:
				case TypeCode.UInt64:
				{
					ldind_i8.end();
					break;
				}
				case TypeCode.Single:
				{
					ldind_r4.end();
					break;
				}
				case TypeCode.Double:
				{
					ldind_r8.end();
					break;
				}
				default:
				{
					if (!type.IsClass)
					{
						if (!type.IsValueType)
						{
							throw CreateNotExpectedTypeException(type);
						}
						stobj(type);
					}
					else
					{
						ldind_ref.end();
					}
					break;
				}
			}
			return this;
		}

		public EmitHelper ldloc(short index)
		{
			_ilGenerator.Emit(OpCodes.Ldloc, index);
			return this;
		}

		public EmitHelper ldloc(LocalBuilder localBuilder)
		{
			_ilGenerator.Emit(OpCodes.Ldloc, localBuilder);
			return this;
		}

		public EmitHelper ldloc_s(byte index)
		{
			_ilGenerator.Emit(OpCodes.Ldloca_S, index);
			return this;
		}

		public EmitHelper ldloca(short index)
		{
			_ilGenerator.Emit(OpCodes.Ldloca, index);
			return this;
		}

		public EmitHelper ldloca(LocalBuilder local)
		{
			_ilGenerator.Emit(OpCodes.Ldloca, local);
			return this;
		}

		public EmitHelper ldloca_s(byte index)
		{
			_ilGenerator.Emit(OpCodes.Ldloca_S, index);
			return this;
		}

		public EmitHelper ldobj(Type type)
		{
			_ilGenerator.Emit(OpCodes.Ldobj, type);
			return this;
		}

		public EmitHelper ldsfld(FieldInfo fieldInfo)
		{
			_ilGenerator.Emit(OpCodes.Ldsfld, fieldInfo);
			return this;
		}

		public EmitHelper ldsflda(FieldInfo fieldInfo)
		{
			_ilGenerator.Emit(OpCodes.Ldsflda, fieldInfo);
			return this;
		}

		public EmitHelper ldstr(string str)
		{
			_ilGenerator.Emit(OpCodes.Ldstr, str);
			return this;
		}

		public EmitHelper ldstrEx(string str)
		{
			return (str == null ? ldnull : ldstr(str));
		}

		public EmitHelper ldtoken(MethodInfo methodInfo)
		{
			_ilGenerator.Emit(OpCodes.Ldtoken, methodInfo);
			return this;
		}

		public EmitHelper ldtoken(FieldInfo fieldInfo)
		{
			_ilGenerator.Emit(OpCodes.Ldtoken, fieldInfo);
			return this;
		}

		public EmitHelper ldtoken(Type type)
		{
			_ilGenerator.Emit(OpCodes.Ldtoken, type);
			return this;
		}

		public EmitHelper ldvirtftn(MethodInfo methodInfo)
		{
			_ilGenerator.Emit(OpCodes.Ldvirtftn, methodInfo);
			return this;
		}

		public EmitHelper leave(Label label)
		{
			_ilGenerator.Emit(OpCodes.Leave, label);
			return this;
		}

		public EmitHelper leave_s(Label label)
		{
			_ilGenerator.Emit(OpCodes.Leave_S, label);
			return this;
		}

		public EmitHelper LoadField(FieldInfo fieldInfo)
		{
			return (fieldInfo.IsStatic ? ldsfld(fieldInfo) : ldarg_0.ldfld(fieldInfo));
		}

		public EmitHelper LoadInitValue(Type type)
		{
			bool flag;
			Guard.ArgumentNotNull(type, "type");
			switch (Type.GetTypeCode(type))
			{
				case TypeCode.Boolean:
				case TypeCode.Char:
				case TypeCode.SByte:
				case TypeCode.Byte:
				case TypeCode.Int16:
				case TypeCode.UInt16:
				case TypeCode.Int32:
				case TypeCode.UInt32:
				{
					ldc_i4_0.end();
					break;
				}
				case TypeCode.Int64:
				case TypeCode.UInt64:
				{
					ldc_i4_0.conv_i8.end();
					break;
				}
				case TypeCode.Single:
				case TypeCode.Double:
				{
					ldc_r4(0f).end();
					break;
				}
				case TypeCode.Decimal:
				case TypeCode.DateTime:
				case TypeCode.Object | TypeCode.DateTime:
				{
					flag = (type.IsClass ? false : !type.IsInterface);
					if (flag)
					{
						throw CreateNotExpectedTypeException(type);
					}
					ldnull.end();
					break;
				}
				case TypeCode.String:
				{
					ldsfld(typeof(string).GetField("Empty"));
					break;
				}
				default:
				{
					goto case TypeCode.Object | TypeCode.DateTime;
				}
			}
			return this;
		}

		public EmitHelper LoadType(Type type)
		{
			EmitHelper emitHelper;
			if (type == null)
			{
				emitHelper = ldnull;
			}
			else
			{
				EmitHelper emitHelper1 = ldtoken(type);
				Type type1 = typeof(Type);
				Type[] typeArray = new Type[] { typeof(RuntimeTypeHandle) };
				emitHelper = emitHelper1.call(type1, "GetTypeFromHandle", typeArray);
			}
			return emitHelper;
		}

		public bool LoadWellKnownValue(object o)
		{
			bool flag;
			if (o != null)
			{
				switch (Type.GetTypeCode(o.GetType()))
				{
					case TypeCode.Boolean:
					{
						ldc_bool((bool)o);
						break;
					}
					case TypeCode.Char:
					{
						ldc_i4_((char)o);
						break;
					}
					case TypeCode.SByte:
					{
						ldc_i4_((sbyte)o);
						break;
					}
					case TypeCode.Byte:
					{
						ldc_i4_((int)o);
						break;
					}
					case TypeCode.Int16:
					{
						ldc_i4_((short)o);
						break;
					}
					case TypeCode.UInt16:
					{
						ldc_i4_((int)o);
						break;
					}
					case TypeCode.Int32:
					{
						ldc_i4_((int)o);
						break;
					}
					case TypeCode.UInt32:
					{
						ldc_i4_((int)o);
						break;
					}
					case TypeCode.Int64:
					{
						ldc_i8((long)o);
						break;
					}
					case TypeCode.UInt64:
					{
						ldc_i8((long)o);
						break;
					}
					case TypeCode.Single:
					{
						ldc_r4((float)o);
						break;
					}
					case TypeCode.Double:
					{
						ldc_r8((double)o);
						break;
					}
					case TypeCode.Decimal:
					case TypeCode.DateTime:
					case TypeCode.Object | TypeCode.DateTime:
					{
						flag = false;
						return flag;
					}
					case TypeCode.String:
					{
						ldstr((string)o);
						break;
					}
					default:
					{
						flag = false;
						return flag;
					}
				}
			}
			else
			{
				ldnull.end();
			}
			flag = true;
			return flag;
		}

		public EmitHelper MarkLabel(Label loc)
		{
			_ilGenerator.MarkLabel(loc);
			return this;
		}

		public EmitHelper MarkSequencePoint(ISymbolDocumentWriter document, int startLine, int startColumn, int endLine, int endColumn)
		{
			_ilGenerator.MarkSequencePoint(document, startLine, startColumn, endLine, endColumn);
			return this;
		}

		public EmitHelper mkrefany(Type type)
		{
			_ilGenerator.Emit(OpCodes.Mkrefany, type);
			return this;
		}

		public EmitHelper newarr(Type type)
		{
			_ilGenerator.Emit(OpCodes.Newarr, type);
			return this;
		}

		public EmitHelper newobj(ConstructorInfo constructorInfo)
		{
			_ilGenerator.Emit(OpCodes.Newobj, constructorInfo);
			return this;
		}

		public EmitHelper newobj(Type type, params Type[] parameters)
		{
			if (type == null)
			{
				throw new ArgumentNullException("type");
			}
			return newobj(type.GetConstructor(parameters));
		}

		public static implicit operator ILGenerator(EmitHelper emitHelper)
		{
			Guard.ArgumentNotNull(emitHelper, "emitHelper");
			return emitHelper.ILGenerator;
		}

		public EmitHelper refanyval(Type type)
		{
			_ilGenerator.Emit(OpCodes.Refanyval, type);
			return this;
		}

		public EmitHelper ret()
		{
			_ilGenerator.Emit(OpCodes.Ret);
			return this;
		}

		public EmitHelper @sizeof(Type type)
		{
			_ilGenerator.Emit(OpCodes.Sizeof, type);
			return this;
		}

		public EmitHelper starg(short index)
		{
			_ilGenerator.Emit(OpCodes.Starg, index);
			return this;
		}

		public EmitHelper starg(int index)
		{
			if (index >= 255)
			{
				if (index >= 32767)
				{
					throw new ArgumentOutOfRangeException("index");
				}
				starg((short)index);
			}
			else
			{
				starg_s((byte)index);
			}
			return this;
		}

		public EmitHelper starg_s(byte index)
		{
			_ilGenerator.Emit(OpCodes.Starg_S, index);
			return this;
		}

		public EmitHelper stelem(Type type)
		{
			_ilGenerator.Emit(OpCodes.Stelem, type);
			return this;
		}

		public EmitHelper stfld(bool isStatic, FieldInfo fieldInfo)
		{
			_ilGenerator.Emit((isStatic ? OpCodes.Stsfld : OpCodes.Stfld), fieldInfo);
			return this;
		}

		public EmitHelper stfld(FieldInfo fieldInfo)
		{
			_ilGenerator.Emit(OpCodes.Stfld, fieldInfo);
			return this;
		}

		public EmitHelper stind(Type type)
		{
			if (type == null)
			{
				throw new ArgumentNullException("type");
			}
			switch (Type.GetTypeCode(type))
			{
				case TypeCode.Boolean:
				case TypeCode.SByte:
				case TypeCode.Byte:
				{
					stind_i1.end();
					break;
				}
				case TypeCode.Char:
				case TypeCode.Int16:
				case TypeCode.UInt16:
				{
					stind_i2.end();
					break;
				}
				case TypeCode.Int32:
				case TypeCode.UInt32:
				{
					stind_i4.end();
					break;
				}
				case TypeCode.Int64:
				case TypeCode.UInt64:
				{
					stind_i8.end();
					break;
				}
				case TypeCode.Single:
				{
					stind_r4.end();
					break;
				}
				case TypeCode.Double:
				{
					stind_r8.end();
					break;
				}
				default:
				{
					if (!type.IsClass)
					{
						if (!type.IsValueType)
						{
							throw CreateNotExpectedTypeException(type);
						}
						stobj(type);
					}
					else
					{
						stind_ref.end();
					}
					break;
				}
			}
			return this;
		}

		public EmitHelper stloc(LocalBuilder local)
		{
			_ilGenerator.Emit(OpCodes.Stloc, local);
			return this;
		}

		public EmitHelper stloc(short index)
		{
			EmitHelper emitHelper;
			if ((index < 0 ? true : index > 255))
			{
				_ilGenerator.Emit(OpCodes.Stloc, index);
				emitHelper = this;
			}
			else
			{
				emitHelper = stloc_s((byte)index);
			}
			return emitHelper;
		}

		public EmitHelper stloc_s(LocalBuilder local)
		{
			_ilGenerator.Emit(OpCodes.Stloc_S, local);
			return this;
		}

		public EmitHelper stloc_s(byte index)
		{
			switch (index)
			{
				case 0:
				{
					stloc_0.end();
					break;
				}
				case 1:
				{
					stloc_1.end();
					break;
				}
				case 2:
				{
					stloc_2.end();
					break;
				}
				case 3:
				{
					stloc_3.end();
					break;
				}
				default:
				{
					_ilGenerator.Emit(OpCodes.Stloc_S, index);
					break;
				}
			}
			return this;
		}

		public EmitHelper stobj(Type type)
		{
			_ilGenerator.Emit(OpCodes.Stobj, type);
			return this;
		}

		public EmitHelper stsfld(FieldInfo fieldInfo)
		{
			_ilGenerator.Emit(OpCodes.Stsfld, fieldInfo);
			return this;
		}

		public EmitHelper @switch(Label[] labels)
		{
			_ilGenerator.Emit(OpCodes.Switch, labels);
			return this;
		}

		public EmitHelper ThrowException(Type exceptionType)
		{
			_ilGenerator.ThrowException(exceptionType);
			return this;
		}

		public EmitHelper unaligned(Label label)
		{
			_ilGenerator.Emit(OpCodes.Unaligned, label);
			return this;
		}

		public EmitHelper unaligned(long addr)
		{
			_ilGenerator.Emit(OpCodes.Unaligned, addr);
			return this;
		}

		public EmitHelper unbox(Type type)
		{
			_ilGenerator.Emit(OpCodes.Unbox, type);
			return this;
		}

		public EmitHelper unbox_any(Type type)
		{
			_ilGenerator.Emit(OpCodes.Unbox_Any, type);
			return this;
		}

		public EmitHelper unboxIfValueType(Type type)
		{
			if (type == null)
			{
				throw new ArgumentNullException("type");
			}
			return (type.IsValueType ? unbox_any(type) : this);
		}

		public EmitHelper UsingNamespace(string namespaceName)
		{
			_ilGenerator.UsingNamespace(namespaceName);
			return this;
		}
	}
}